package com.guigusuqi.hy.controller;


import com.guigusuqi.app.entity.LoginWxUser;
import com.guigusuqi.commonutils.utils.GetTokenByAuthorizationUtils;
import com.guigusuqi.commonutils.utils.RedisCache;
import com.guigusuqi.commonutils.vo.Result;
import com.guigusuqi.hy.service.IntegralAdminService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

/**
 * <p>
 * 积分明细管理 前端控制器
 * </p>
 *
 * @author suqi
 * @since 2022-04-14
 */
@RestController
@RequestMapping("/hy/integral-admin")
@Api(tags = {"wx-积分管理模块"})
public class IntegralAdminController
{
    @Resource
    private IntegralAdminService integralAdminService;

    @ApiOperation("添加用户积分")
    @GetMapping("addIntegral/{integralType}/{openid}")
    public Result addIntegral(@PathVariable String integralType,
                              @PathVariable String openid) throws IOException
    {
        return integralAdminService.addIntegral(integralType,openid);
    }

    @ApiOperation("查看用户绑定的会员卡的积分详情")
    @GetMapping("/selectUserIntegral")
    public Result selectUserIntegral() throws IOException
    {
        return integralAdminService.selectUserIntegral();
    }
}
